<?php

include_once($ROOT . "base.inc.php");

class PageController extends BaseController {
  var $song;
  var $songs;
  var $sort;

  function PageController() {
  	parent::__construct();
	$this->title = "Songs";
	$this->section = "songs";

	$action = $this->getParameter("action");
	switch (strtoupper($action))
	{

		case "SEARCH" :
		default :
			$this->song = new Song();
			$this->parseForm();

			$this->songs = SongLogic::findByExample($this->song, $this->sort);
			break;
	}
  }

  function parseForm() {
	$this->song->readForm();
	$this->sort = $this->getParameter("sort");
	if ($this->sort == "")
	{
		$this->sort = "title";
	}
  }

  function validate() {
	return (sizeof($this->errs) == 0);
  }
}



?>
